{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"src\", \"alt\", \"onClose\", \"afterClose\", \"visible\", \"icons\", \"rootClassName\", \"getContainer\", \"countRender\", \"scaleStep\", \"transitionName\", \"maskTransitionName\"];\nimport React, { useState, useEffect, useCallback, useRef, useContext } from 'react';\nimport Dialog from 'rc-dialog';\nimport classnames from 'classnames';\nimport addEventListener from \"rc-util/es/Dom/addEventListener\";\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport { warning } from \"rc-util/es/warning\";\nimport { context } from \"./PreviewGroup\";\nimport Operations from \"./Operations\";\nimport useImageTransform from \"./hooks/useImageTransform\";\nimport getFixScaleEleTransPosition from \"./getFixScaleEleTransPosition\";\nimport { BASE_SCALE_RATIO, WHEEL_MAX_SCALE_RATIO } from \"./previewConfig\";\nvar Preview = function Preview(props) {\n  var prefixCls = props.prefixCls,\n    src = props.src,\n    alt = props.alt,\n    onClose = props.onClose,\n    afterClose = props.afterClose,\n    visible = props.visible,\n    _props$icons = props.icons,\n    icons = _props$icons === void 0 ? {} : _props$icons,\n    rootClassName = props.rootClassName,\n    getContainer = props.getContainer,\n    countRender = props.countRender,\n    _props$scaleStep = props.scaleStep,\n    scaleStep = _props$scaleStep === void 0 ? 0.5 : _props$scaleStep,\n    _props$transitionName = props.transitionName,\n    transitionName = _props$transitionName === void 0 ? 'zoom' : _props$transitionName,\n    _props$maskTransition = props.maskTransitionName,\n    maskTransitionName = _props$maskTransition === void 0 ? 'fade' : _props$maskTransition,\n    restProps = _objectWithoutProperties(props, _excluded);\n  var imgRef = useRef();\n  var downPositionRef = useRef({\n    deltaX: 0,\n    deltaY: 0,\n    transformX: 0,\n    transformY: 0\n  });\n  var _useState = useState(false),\n    _useState2 = _slicedToArray(_useState, 2),\n    isMoving = _useState2[0],\n    setMoving = _useState2[1];\n  var _useContext = useContext(context),\n    previewUrls = _useContext.previewUrls,\n    current = _useContext.current,\n    isPreviewGroup = _useContext.isPreviewGroup,\n    setCurrent = _useContext.setCurrent;\n  var previewGroupCount = previewUrls.size;\n  var previewUrlsKeys = Array.from(previewUrls.keys());\n  var currentPreviewIndex = previewUrlsKeys.indexOf(current);\n  var combinationSrc = isPreviewGroup ? previewUrls.get(current) : src;\n  var showLeftOrRightSwitches = isPreviewGroup && previewGroupCount > 1;\n  var showOperationsProgress = isPreviewGroup && previewGroupCount >= 1;\n  var _useImageTransform = useImageTransform(imgRef),\n    transform = _useImageTransform.transform,\n    resetTransform = _useImageTransform.resetTransform,\n    updateTransform = _useImageTransform.updateTransform,\n    dispatchZoonChange = _useImageTransform.dispatchZoonChange;\n  var rotate = transform.rotate,\n    scale = transform.scale;\n  var wrapClassName = classnames(_defineProperty({}, \"\".concat(prefixCls, \"-moving\"), isMoving));\n  var onAfterClose = function onAfterClose() {\n    resetTransform();\n  };\n  var onZoomIn = function onZoomIn() {\n    dispatchZoonChange(BASE_SCALE_RATIO + scaleStep);\n  };\n  var onZoomOut = function onZoomOut() {\n    dispatchZoonChange(BASE_SCALE_RATIO - scaleStep);\n  };\n  var onRotateRight = function onRotateRight() {\n    updateTransform({\n      rotate: rotate + 90\n    });\n  };\n  var onRotateLeft = function onRotateLeft() {\n    updateTransform({\n      rotate: rotate - 90\n    });\n  };\n  var onSwitchLeft = function onSwitchLeft(event) {\n    event.preventDefault();\n    event.stopPropagation();\n    if (currentPreviewIndex > 0) {\n      setCurrent(previewUrlsKeys[currentPreviewIndex - 1]);\n    }\n  };\n  var onSwitchRight = function onSwitchRight(event) {\n    event.preventDefault();\n    event.stopPropagation();\n    if (currentPreviewIndex < previewGroupCount - 1) {\n      setCurrent(previewUrlsKeys[currentPreviewIndex + 1]);\n    }\n  };\n  var onMouseUp = function onMouseUp() {\n    if (visible && isMoving) {\n      setMoving(false);\n      /** No need to restore the position when the picture is not moved, So as not to interfere with the click */\n\n      var _downPositionRef$curr = downPositionRef.current,\n        transformX = _downPositionRef$curr.transformX,\n        transformY = _downPositionRef$curr.transformY;\n      var hasChangedPosition = transform.x !== transformX && transform.y !== transformY;\n      if (!hasChangedPosition) {\n        return;\n      }\n      var width = imgRef.current.offsetWidth * scale;\n      var height = imgRef.current.offsetHeight * scale; // eslint-disable-next-line @typescript-eslint/no-shadow\n\n      var _imgRef$current$getBo = imgRef.current.getBoundingClientRect(),\n        left = _imgRef$current$getBo.left,\n        top = _imgRef$current$getBo.top;\n      var isRotate = rotate % 180 !== 0;\n      var fixState = getFixScaleEleTransPosition(isRotate ? height : width, isRotate ? width : height, left, top);\n      if (fixState) {\n        updateTransform(_objectSpread({}, fixState));\n      }\n    }\n  };\n  var onMouseDown = function onMouseDown(event) {\n    // Only allow main button\n    if (event.button !== 0) return;\n    event.preventDefault();\n    event.stopPropagation();\n    downPositionRef.current = {\n      deltaX: event.pageX - transform.x,\n      deltaY: event.pageY - transform.y,\n      transformX: transform.x,\n      transformY: transform.y\n    };\n    setMoving(true);\n  };\n  var onMouseMove = function onMouseMove(event) {\n    if (visible && isMoving) {\n      updateTransform({\n        x: event.pageX - downPositionRef.current.deltaX,\n        y: event.pageY - downPositionRef.current.deltaY\n      });\n    }\n  };\n  var onWheel = function onWheel(event) {\n    if (!visible || event.deltaY == 0) return; // Scale ratio depends on the deltaY size\n\n    var scaleRatio = Math.abs(event.deltaY / 100); // Limit the maximum scale ratio\n\n    var mergedScaleRatio = Math.min(scaleRatio, WHEEL_MAX_SCALE_RATIO); // Scale the ratio each time\n\n    var ratio = BASE_SCALE_RATIO + mergedScaleRatio * scaleStep;\n    if (event.deltaY > 0) {\n      ratio = BASE_SCALE_RATIO / ratio;\n    }\n    dispatchZoonChange(ratio, event.clientX, event.clientY);\n  };\n  var onKeyDown = useCallback(function (event) {\n    if (!visible || !showLeftOrRightSwitches) return;\n    if (event.keyCode === KeyCode.LEFT) {\n      if (currentPreviewIndex > 0) {\n        setCurrent(previewUrlsKeys[currentPreviewIndex - 1]);\n      }\n    } else if (event.keyCode === KeyCode.RIGHT) {\n      if (currentPreviewIndex < previewGroupCount - 1) {\n        setCurrent(previewUrlsKeys[currentPreviewIndex + 1]);\n      }\n    }\n  }, [currentPreviewIndex, previewGroupCount, previewUrlsKeys, setCurrent, showLeftOrRightSwitches, visible]);\n  var onDoubleClick = function onDoubleClick(event) {\n    if (visible) {\n      if (scale !== 1) {\n        updateTransform({\n          x: 0,\n          y: 0,\n          scale: 1\n        });\n      } else {\n        dispatchZoonChange(BASE_SCALE_RATIO + scaleStep, event.clientX, event.clientY);\n      }\n    }\n  };\n  useEffect(function () {\n    var onTopMouseUpListener;\n    var onTopMouseMoveListener;\n    var onMouseUpListener = addEventListener(window, 'mouseup', onMouseUp, false);\n    var onMouseMoveListener = addEventListener(window, 'mousemove', onMouseMove, false);\n    var onKeyDownListener = addEventListener(window, 'keydown', onKeyDown, false);\n    try {\n      // Resolve if in iframe lost event\n\n      /* istanbul ignore next */\n      if (window.top !== window.self) {\n        onTopMouseUpListener = addEventListener(window.top, 'mouseup', onMouseUp, false);\n        onTopMouseMoveListener = addEventListener(window.top, 'mousemove', onMouseMove, false);\n      }\n    } catch (error) {\n      /* istanbul ignore next */\n      warning(false, \"[rc-image] \".concat(error));\n    }\n    return function () {\n      var _onTopMouseUpListener, _onTopMouseMoveListen;\n      onMouseUpListener.remove();\n      onMouseMoveListener.remove();\n      onKeyDownListener.remove();\n      /* istanbul ignore next */\n\n      (_onTopMouseUpListener = onTopMouseUpListener) === null || _onTopMouseUpListener === void 0 ? void 0 : _onTopMouseUpListener.remove();\n      /* istanbul ignore next */\n\n      (_onTopMouseMoveListen = onTopMouseMoveListener) === null || _onTopMouseMoveListen === void 0 ? void 0 : _onTopMouseMoveListen.remove();\n    };\n  }, [visible, isMoving, onKeyDown]);\n  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Dialog, _extends({\n    transitionName: transitionName,\n    maskTransitionName: maskTransitionName,\n    closable: false,\n    keyboard: true,\n    prefixCls: prefixCls,\n    onClose: onClose,\n    afterClose: onAfterClose,\n    visible: visible,\n    wrapClassName: wrapClassName,\n    rootClassName: rootClassName,\n    getContainer: getContainer\n  }, restProps), /*#__PURE__*/React.createElement(\"div\", {\n    className: \"\".concat(prefixCls, \"-img-wrapper\")\n  }, /*#__PURE__*/React.createElement(\"img\", {\n    width: props.width,\n    height: props.height,\n    onWheel: onWheel,\n    onMouseDown: onMouseDown,\n    onDoubleClick: onDoubleClick,\n    ref: imgRef,\n    className: \"\".concat(prefixCls, \"-img\"),\n    src: combinationSrc,\n    alt: alt,\n    style: {\n      transform: \"translate3d(\".concat(transform.x, \"px, \").concat(transform.y, \"px, 0) scale3d(\").concat(scale, \", \").concat(scale, \", 1) rotate(\").concat(rotate, \"deg)\")\n    }\n  }))), /*#__PURE__*/React.createElement(Operations, {\n    visible: visible,\n    maskTransitionName: maskTransitionName,\n    getContainer: getContainer,\n    prefixCls: prefixCls,\n    rootClassName: rootClassName,\n    icons: icons,\n    countRender: countRender,\n    showSwitch: showLeftOrRightSwitches,\n    showProgress: showOperationsProgress,\n    current: currentPreviewIndex,\n    count: previewGroupCount,\n    scale: scale,\n    onSwitchLeft: onSwitchLeft,\n    onSwitchRight: onSwitchRight,\n    onZoomIn: onZoomIn,\n    onZoomOut: onZoomOut,\n    onRotateRight: onRotateRight,\n    onRotateLeft: onRotateLeft,\n    onClose: onClose\n  }));\n};\nexport default Preview;","map":{"version":3,"names":["_extends","_objectSpread","_defineProperty","_slicedToArray","_objectWithoutProperties","_excluded","React","useState","useEffect","useCallback","useRef","useContext","Dialog","classnames","addEventListener","KeyCode","warning","context","Operations","useImageTransform","getFixScaleEleTransPosition","BASE_SCALE_RATIO","WHEEL_MAX_SCALE_RATIO","Preview","props","prefixCls","src","alt","onClose","afterClose","visible","_props$icons","icons","rootClassName","getContainer","countRender","_props$scaleStep","scaleStep","_props$transitionName","transitionName","_props$maskTransition","maskTransitionName","restProps","imgRef","downPositionRef","deltaX","deltaY","transformX","transformY","_useState","_useState2","isMoving","setMoving","_useContext","previewUrls","current","isPreviewGroup","setCurrent","previewGroupCount","size","previewUrlsKeys","Array","from","keys","currentPreviewIndex","indexOf","combinationSrc","get","showLeftOrRightSwitches","showOperationsProgress","_useImageTransform","transform","resetTransform","updateTransform","dispatchZoonChange","rotate","scale","wrapClassName","concat","onAfterClose","onZoomIn","onZoomOut","onRotateRight","onRotateLeft","onSwitchLeft","event","preventDefault","stopPropagation","onSwitchRight","onMouseUp","_downPositionRef$curr","hasChangedPosition","x","y","width","offsetWidth","height","offsetHeight","_imgRef$current$getBo","getBoundingClientRect","left","top","isRotate","fixState","onMouseDown","button","pageX","pageY","onMouseMove","onWheel","scaleRatio","Math","abs","mergedScaleRatio","min","ratio","clientX","clientY","onKeyDown","keyCode","LEFT","RIGHT","onDoubleClick","onTopMouseUpListener","onTopMouseMoveListener","onMouseUpListener","window","onMouseMoveListener","onKeyDownListener","self","error","_onTopMouseUpListener","_onTopMouseMoveListen","remove","createElement","Fragment","closable","keyboard","className","ref","style","showSwitch","showProgress","count"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/rc-image/es/Preview.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"src\", \"alt\", \"onClose\", \"afterClose\", \"visible\", \"icons\", \"rootClassName\", \"getContainer\", \"countRender\", \"scaleStep\", \"transitionName\", \"maskTransitionName\"];\nimport React, { useState, useEffect, useCallback, useRef, useContext } from 'react';\nimport Dialog from 'rc-dialog';\nimport classnames from 'classnames';\nimport addEventListener from \"rc-util/es/Dom/addEventListener\";\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport { warning } from \"rc-util/es/warning\";\nimport { context } from \"./PreviewGroup\";\nimport Operations from \"./Operations\";\nimport useImageTransform from \"./hooks/useImageTransform\";\nimport getFixScaleEleTransPosition from \"./getFixScaleEleTransPosition\";\nimport { BASE_SCALE_RATIO, WHEEL_MAX_SCALE_RATIO } from \"./previewConfig\";\n\nvar Preview = function Preview(props) {\n  var prefixCls = props.prefixCls,\n      src = props.src,\n      alt = props.alt,\n      onClose = props.onClose,\n      afterClose = props.afterClose,\n      visible = props.visible,\n      _props$icons = props.icons,\n      icons = _props$icons === void 0 ? {} : _props$icons,\n      rootClassName = props.rootClassName,\n      getContainer = props.getContainer,\n      countRender = props.countRender,\n      _props$scaleStep = props.scaleStep,\n      scaleStep = _props$scaleStep === void 0 ? 0.5 : _props$scaleStep,\n      _props$transitionName = props.transitionName,\n      transitionName = _props$transitionName === void 0 ? 'zoom' : _props$transitionName,\n      _props$maskTransition = props.maskTransitionName,\n      maskTransitionName = _props$maskTransition === void 0 ? 'fade' : _props$maskTransition,\n      restProps = _objectWithoutProperties(props, _excluded);\n\n  var imgRef = useRef();\n  var downPositionRef = useRef({\n    deltaX: 0,\n    deltaY: 0,\n    transformX: 0,\n    transformY: 0\n  });\n\n  var _useState = useState(false),\n      _useState2 = _slicedToArray(_useState, 2),\n      isMoving = _useState2[0],\n      setMoving = _useState2[1];\n\n  var _useContext = useContext(context),\n      previewUrls = _useContext.previewUrls,\n      current = _useContext.current,\n      isPreviewGroup = _useContext.isPreviewGroup,\n      setCurrent = _useContext.setCurrent;\n\n  var previewGroupCount = previewUrls.size;\n  var previewUrlsKeys = Array.from(previewUrls.keys());\n  var currentPreviewIndex = previewUrlsKeys.indexOf(current);\n  var combinationSrc = isPreviewGroup ? previewUrls.get(current) : src;\n  var showLeftOrRightSwitches = isPreviewGroup && previewGroupCount > 1;\n  var showOperationsProgress = isPreviewGroup && previewGroupCount >= 1;\n\n  var _useImageTransform = useImageTransform(imgRef),\n      transform = _useImageTransform.transform,\n      resetTransform = _useImageTransform.resetTransform,\n      updateTransform = _useImageTransform.updateTransform,\n      dispatchZoonChange = _useImageTransform.dispatchZoonChange;\n\n  var rotate = transform.rotate,\n      scale = transform.scale;\n  var wrapClassName = classnames(_defineProperty({}, \"\".concat(prefixCls, \"-moving\"), isMoving));\n\n  var onAfterClose = function onAfterClose() {\n    resetTransform();\n  };\n\n  var onZoomIn = function onZoomIn() {\n    dispatchZoonChange(BASE_SCALE_RATIO + scaleStep);\n  };\n\n  var onZoomOut = function onZoomOut() {\n    dispatchZoonChange(BASE_SCALE_RATIO - scaleStep);\n  };\n\n  var onRotateRight = function onRotateRight() {\n    updateTransform({\n      rotate: rotate + 90\n    });\n  };\n\n  var onRotateLeft = function onRotateLeft() {\n    updateTransform({\n      rotate: rotate - 90\n    });\n  };\n\n  var onSwitchLeft = function onSwitchLeft(event) {\n    event.preventDefault();\n    event.stopPropagation();\n\n    if (currentPreviewIndex > 0) {\n      setCurrent(previewUrlsKeys[currentPreviewIndex - 1]);\n    }\n  };\n\n  var onSwitchRight = function onSwitchRight(event) {\n    event.preventDefault();\n    event.stopPropagation();\n\n    if (currentPreviewIndex < previewGroupCount - 1) {\n      setCurrent(previewUrlsKeys[currentPreviewIndex + 1]);\n    }\n  };\n\n  var onMouseUp = function onMouseUp() {\n    if (visible && isMoving) {\n      setMoving(false);\n      /** No need to restore the position when the picture is not moved, So as not to interfere with the click */\n\n      var _downPositionRef$curr = downPositionRef.current,\n          transformX = _downPositionRef$curr.transformX,\n          transformY = _downPositionRef$curr.transformY;\n      var hasChangedPosition = transform.x !== transformX && transform.y !== transformY;\n\n      if (!hasChangedPosition) {\n        return;\n      }\n\n      var width = imgRef.current.offsetWidth * scale;\n      var height = imgRef.current.offsetHeight * scale; // eslint-disable-next-line @typescript-eslint/no-shadow\n\n      var _imgRef$current$getBo = imgRef.current.getBoundingClientRect(),\n          left = _imgRef$current$getBo.left,\n          top = _imgRef$current$getBo.top;\n\n      var isRotate = rotate % 180 !== 0;\n      var fixState = getFixScaleEleTransPosition(isRotate ? height : width, isRotate ? width : height, left, top);\n\n      if (fixState) {\n        updateTransform(_objectSpread({}, fixState));\n      }\n    }\n  };\n\n  var onMouseDown = function onMouseDown(event) {\n    // Only allow main button\n    if (event.button !== 0) return;\n    event.preventDefault();\n    event.stopPropagation();\n    downPositionRef.current = {\n      deltaX: event.pageX - transform.x,\n      deltaY: event.pageY - transform.y,\n      transformX: transform.x,\n      transformY: transform.y\n    };\n    setMoving(true);\n  };\n\n  var onMouseMove = function onMouseMove(event) {\n    if (visible && isMoving) {\n      updateTransform({\n        x: event.pageX - downPositionRef.current.deltaX,\n        y: event.pageY - downPositionRef.current.deltaY\n      });\n    }\n  };\n\n  var onWheel = function onWheel(event) {\n    if (!visible || event.deltaY == 0) return; // Scale ratio depends on the deltaY size\n\n    var scaleRatio = Math.abs(event.deltaY / 100); // Limit the maximum scale ratio\n\n    var mergedScaleRatio = Math.min(scaleRatio, WHEEL_MAX_SCALE_RATIO); // Scale the ratio each time\n\n    var ratio = BASE_SCALE_RATIO + mergedScaleRatio * scaleStep;\n\n    if (event.deltaY > 0) {\n      ratio = BASE_SCALE_RATIO / ratio;\n    }\n\n    dispatchZoonChange(ratio, event.clientX, event.clientY);\n  };\n\n  var onKeyDown = useCallback(function (event) {\n    if (!visible || !showLeftOrRightSwitches) return;\n\n    if (event.keyCode === KeyCode.LEFT) {\n      if (currentPreviewIndex > 0) {\n        setCurrent(previewUrlsKeys[currentPreviewIndex - 1]);\n      }\n    } else if (event.keyCode === KeyCode.RIGHT) {\n      if (currentPreviewIndex < previewGroupCount - 1) {\n        setCurrent(previewUrlsKeys[currentPreviewIndex + 1]);\n      }\n    }\n  }, [currentPreviewIndex, previewGroupCount, previewUrlsKeys, setCurrent, showLeftOrRightSwitches, visible]);\n\n  var onDoubleClick = function onDoubleClick(event) {\n    if (visible) {\n      if (scale !== 1) {\n        updateTransform({\n          x: 0,\n          y: 0,\n          scale: 1\n        });\n      } else {\n        dispatchZoonChange(BASE_SCALE_RATIO + scaleStep, event.clientX, event.clientY);\n      }\n    }\n  };\n\n  useEffect(function () {\n    var onTopMouseUpListener;\n    var onTopMouseMoveListener;\n    var onMouseUpListener = addEventListener(window, 'mouseup', onMouseUp, false);\n    var onMouseMoveListener = addEventListener(window, 'mousemove', onMouseMove, false);\n    var onKeyDownListener = addEventListener(window, 'keydown', onKeyDown, false);\n\n    try {\n      // Resolve if in iframe lost event\n\n      /* istanbul ignore next */\n      if (window.top !== window.self) {\n        onTopMouseUpListener = addEventListener(window.top, 'mouseup', onMouseUp, false);\n        onTopMouseMoveListener = addEventListener(window.top, 'mousemove', onMouseMove, false);\n      }\n    } catch (error) {\n      /* istanbul ignore next */\n      warning(false, \"[rc-image] \".concat(error));\n    }\n\n    return function () {\n      var _onTopMouseUpListener, _onTopMouseMoveListen;\n\n      onMouseUpListener.remove();\n      onMouseMoveListener.remove();\n      onKeyDownListener.remove();\n      /* istanbul ignore next */\n\n      (_onTopMouseUpListener = onTopMouseUpListener) === null || _onTopMouseUpListener === void 0 ? void 0 : _onTopMouseUpListener.remove();\n      /* istanbul ignore next */\n\n      (_onTopMouseMoveListen = onTopMouseMoveListener) === null || _onTopMouseMoveListen === void 0 ? void 0 : _onTopMouseMoveListen.remove();\n    };\n  }, [visible, isMoving, onKeyDown]);\n  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Dialog, _extends({\n    transitionName: transitionName,\n    maskTransitionName: maskTransitionName,\n    closable: false,\n    keyboard: true,\n    prefixCls: prefixCls,\n    onClose: onClose,\n    afterClose: onAfterClose,\n    visible: visible,\n    wrapClassName: wrapClassName,\n    rootClassName: rootClassName,\n    getContainer: getContainer\n  }, restProps), /*#__PURE__*/React.createElement(\"div\", {\n    className: \"\".concat(prefixCls, \"-img-wrapper\")\n  }, /*#__PURE__*/React.createElement(\"img\", {\n    width: props.width,\n    height: props.height,\n    onWheel: onWheel,\n    onMouseDown: onMouseDown,\n    onDoubleClick: onDoubleClick,\n    ref: imgRef,\n    className: \"\".concat(prefixCls, \"-img\"),\n    src: combinationSrc,\n    alt: alt,\n    style: {\n      transform: \"translate3d(\".concat(transform.x, \"px, \").concat(transform.y, \"px, 0) scale3d(\").concat(scale, \", \").concat(scale, \", 1) rotate(\").concat(rotate, \"deg)\")\n    }\n  }))), /*#__PURE__*/React.createElement(Operations, {\n    visible: visible,\n    maskTransitionName: maskTransitionName,\n    getContainer: getContainer,\n    prefixCls: prefixCls,\n    rootClassName: rootClassName,\n    icons: icons,\n    countRender: countRender,\n    showSwitch: showLeftOrRightSwitches,\n    showProgress: showOperationsProgress,\n    current: currentPreviewIndex,\n    count: previewGroupCount,\n    scale: scale,\n    onSwitchLeft: onSwitchLeft,\n    onSwitchRight: onSwitchRight,\n    onZoomIn: onZoomIn,\n    onZoomOut: onZoomOut,\n    onRotateRight: onRotateRight,\n    onRotateLeft: onRotateLeft,\n    onClose: onClose\n  }));\n};\n\nexport default Preview;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,aAAa,MAAM,0CAA0C;AACpE,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAOC,cAAc,MAAM,0CAA0C;AACrE,OAAOC,wBAAwB,MAAM,oDAAoD;AACzF,IAAIC,SAAS,GAAG,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,oBAAoB,CAAC;AAC7L,OAAOC,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,EAAEC,MAAM,EAAEC,UAAU,QAAQ,OAAO;AACnF,OAAOC,MAAM,MAAM,WAAW;AAC9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